package com.example.selfcontrol.entity.resp;

import com.example.selfcontrol.entity.User;
import lombok.Data;

@Data
public class UserResponse {
    private Long id;
    private String name;
    private String password ;
    private Integer age;
    private String email;
    private boolean gender ;

    private String picture ;
    private Integer followers ;
    private Integer subscribes ;
    private String jwtToken;

    private Integer articleCount ;

    private String nickName ;

    public static UserResponse createFromUser(User user,String token) {
        UserResponse ans = new UserResponse() ;

        ans.setAge(user.getAge());
        ans.setId(user.getId());
        ans.setName(user.getName());
        ans.setPassword(user.getPassword());
        ans.setFollowers(user.getFollowers());
        ans.setSubscribes(user.getSubscribes());
        ans.setEmail(user.getEmail());
        ans.setJwtToken(token);
        ans.setPicture(user.getPicture());
        ans.setGender(user.isGender());
        ans.setArticleCount(user.getArticleCount());
        ans.setNickName(user.getNickName());

        return ans ;
    }
}
